package com.ruiysoft.service.integralmdse.consts;

import java.util.Objects;

public enum MdseMPType {
    //类型（1，纯现金或纯积分，2，固定现金+固定积分，3，积分抵现金）
    M_OR_I(1, "纯现金或纯积分"), M_AND_I(2, "固定现金+固定积分"), M_TO_I(3, "积分抵现金");
    private int index;
    private String name;

    private MdseMPType(int index, String name) {
        this.index = index;
        this.name = name;
    }

    public static String getName(int index) {
        for (MdseMPType s : MdseMPType.values()) {
            if (Objects.equals(s.getIndex(),index)) {
                return s.getName();
            }
        }
        return null;
    }

    public static MdseMPType getEnum(int index) {
        for (MdseMPType s : MdseMPType.values()) {
            if (Objects.equals(s.getIndex(),index)) {
                return s;
            }
        }
        return null;
    }

    public int getIndex() {
        return this.index;
    }

    public String getName() {
        return this.name;
    }
}
